package com.google.p.code.springscim.client.syncup;

import java.util.HashMap;
import java.util.Map;

public class ScimSyncUpStrategyManager {
    
    private static class ScimSyncUpStrategyManagerHolder {
        static final ScimSyncUpStrategyManager instance = new ScimSyncUpStrategyManager();
    }
    
    public static ScimSyncUpStrategyManager getInstance() {
        return ScimSyncUpStrategyManagerHolder.instance;
    }
    
    private Map<ScimSyncUpType, ScimSyncUpStrategy> repository = new HashMap<ScimSyncUpType, ScimSyncUpStrategy>();
    
    private ScimSyncUpStrategyManager() {
        registerAll();
    }
    
    private void registerAll() {
        // TODO
    }
    
    public void register(ScimSyncUpType type, ScimSyncUpStrategy strategy) {
        repository.put(type, strategy);
    }
    
    public ScimSyncUpStrategy unregister(ScimSyncUpType type) {
        return repository.remove(type);
    }
    
    public ScimSyncUpStrategy getStrategy(ScimSyncUpType type) {
        return repository.get(type);
    }
}
